import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import get from '@dfeidao/atom-mobile/local/get';
import set from '@dfeidao/atom-mobile/local/set';
import nodejs from '@dfeidao/atom-mobile/msg/nodejs';
import get_param from '@dfeidao/atom-mobile/nav/get-param';
import render from '@dfeidao/atom-mobile/render/render';
import whoami from '../atom/whoami_getparams';





export default async function a001(fd: IFeidaoAiMobile) {
	// 初始化
	const user = await whoami(fd) as {
		params: {
			teacher_name: string;
			productid: string;
			teacher_no: string;
		}
	};
	set(fd, 'productid', user.params.productid);
	const productid = get(fd, 'productid');

	const job_no = get_param(fd, 'job_no');
	// const job_no = 'ZY000324';
	set(fd, 'job_no', job_no);
	const d = await nodejs<{ dataArray: Array<{ quote_job_name: string, contents_homework: string, personalized_setting: string, class_name: string; class_id: string, create_time: number, c_time: string }> }>('app-homework-detail/s001', {
		filter: { job_no }, productid
	});
	await set(fd, 'data', d);
	render(fd, { data: d.dataArray });


}
